package cn.lili.modules.goods.client;

import cn.lili.common.vo.ResultMessage;
import cn.lili.modules.constant.ServiceConstant;
import cn.lili.modules.goods.fallback.GrabOrderback;
import cn.lili.modules.grab.GrabNoticeParam;
import cn.lili.modules.grab.GrabOrderParam;
import cn.lili.modules.grab.dingdong.base.BaseResult;
import cn.lili.modules.grab.dingdong.reps.order.FreightCalcRespose;
import cn.lili.modules.grab.dingdong.res.notice.OrderCallbackRequest;
import cn.lili.modules.grab.dingdong.res.order.CreateOrderRequest;
import cn.lili.modules.grab.dingdong.res.order.FreightCalcRequest;
import cn.lili.modules.grab.xdxt.reps.order.OrderFreightPreviewReps;
import cn.lili.modules.grab.xdxt.res.order.OrderFreightPreviewReq;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@Service
@FeignClient(path = "${server.servlet.context-path}", name = ServiceConstant.GOODS_SERVICE, contextId = "grab", fallback = GrabOrderback.class)
public interface GrabOrderClient {

    /**
     * 企叮咚-发起订单
     *
     * @param grabOrderParam 订单信息
     */
    @PostMapping("/feign/grab/add")
    void grabOrder(@RequestBody GrabOrderParam grabOrderParam);

    /**
     * 重新发送企叮咚下单
     * @param
     * @param
     */
    @PostMapping("/feign/grab/qidingdong/retryCreateOrder")
    ResultMessage<Object> retryCreateOrder(@RequestBody CreateOrderRequest createOrderRequest);

    /**
     * 重新发送企叮咚下单--回调请求
     * @param
     * @param
     */
    @PostMapping("/feign/grab/qidingdong/retryCreateOrderCallback")
    ResultMessage<Object> retryCreateOrderCallback(@RequestBody OrderCallbackRequest orderCallbackRequest);

    /**
     * 企叮咚运费计算
     *
     * @param freightCalcRequest 请求内容
     */
    @PostMapping("/feign/grab/freightCalc")
    FreightCalcRespose freightCalc(@RequestBody FreightCalcRequest freightCalcRequest);

    /**
     * 盛创汇联运费计算
     * */
    @PostMapping("/feign/grab/xdxt/freightCalc")
    OrderFreightPreviewReps xdxtFreightCalc(@RequestBody OrderFreightPreviewReq orderFreightPreviewReq);

    /**
     * 盛创汇联-商品变动回调
     * */
    @PostMapping("/feign/grab/xdxt/goodsCallback")
    BaseResult goodsCallback(@RequestBody GrabNoticeParam grabParam);

    /**
     * 盛创汇联-订单变动回调
     * */
    @PostMapping("/feign/grab/xdxt/orderCallback")
    BaseResult orderCallback(@RequestBody GrabNoticeParam grabParam);
}
